import java.util.Arrays;

public class Test {
    public static void main(String[] args) {//二维数组
        int[][] array = {{1,2,3},{4,5,6}};
        for (int i = 0;i < 2;i++) {
            for (int j = 0; j < 3; j++) {
                System.out.print(array[i][j] + "");
            }
            System.out.println();
        }
    }
    public static void swap(int[] array,int i,int j) {//数组逆序
        int tmp = array[i];
        array[i] = array[j];
        array[j] = tmp;
    }

    public static void reverse(int[] array) {//数组逆序
        int left = 0;
        int right = array.length-1;
        while (left < right){
            swap(array,left,right);
            left++;
            right--;
        }
    }

    public static void main1(String[] args) {
        int[] array = {6,5,5,1};
        reverse(array);
        System.out.println(Arrays.toString(array));
    }
}
